package com.zimug.boot.launch.controller;


import com.zimug.boot.launch.config.event.MyEvent;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;


@RestController
public class HelloController {

  @Resource
  private
  ApplicationContext applicationContext;

  @GetMapping("/hello")
  public String hello(HttpServletRequest request,
                      HttpSession session) {

    applicationContext.publishEvent(new MyEvent("事件测试"));

    return "hello world1-----";
  }
}
